package com.jarvis.zeng.design.pattern.decorator.drawshape;

public class ShapeDecorator implements Shape {

    private Shape shape;
    private Color color;

    public ShapeDecorator(Shape shape){
        this.shape = shape;
    }

    public ShapeDecorator(Shape shape, Color color){
        this.shape = shape;
        this.color = color;
    }

    @Override
    public void draw() {
        if(shape!=null){
            shape.draw();
        }
        if(color!=null){
            color.draw();
        }
    }
}
